package com.yuwei.module_repair.model

import com.bw.lib_common.entity.AddRepairEntity
import com.bw.lib_common.entity.RepairEntity
import com.bw.lib_common.entity.RepairEntityItem
import com.bw.lib_common.entity.Res
import com.bw.lib_common.model.BaseRepository
import com.bw.lib_http.OkHttpClientManager
import com.yuwei.module_repair.api.RepairApiService
/**
 * 智慧园区-01-设备管理V1.1-20250507
 */
class RepairRepository:BaseRepository<RepairApiService>() {
    override fun createApiServer(): RepairApiService =OkHttpClientManager.retrofitInstance.create(RepairApiService::class.java)


    suspend fun getRepairList():Res<RepairEntity> = apiService.getRepairOrders()
    suspend fun addRepair(addRepairEntity: AddRepairEntity):Res<RepairEntityItem> = apiService.addRepairOrder(addRepairEntity)
    suspend fun deleteRepair(id:Int):Res<Boolean> =apiService.deleteRepairOrder(id)
    suspend fun getRepairOrderByNumber(orderNumber:String):Res<RepairEntityItem> =apiService.getRepairOrderByOrderNumber(orderNumber)
    suspend fun getRepairOrderByName(name:String):Res<RepairEntity> =apiService.getRepairOrderByName(name)
}